.thread-mailer__footer
  - if @notification
    %img.thread-mailer__footer-image{src: mark_notification_as_read_pixel_src(@notification), alt: '', width: 1, height: 1}
  - if @recipient.is_logged_in?
    - if @discussion
      %img.thread-mailer__footer-image{src: pixel_src(@event), alt: '', width: 1, height: 1}

    %p.thread-mailer__footer-links
      &mdash;
      %br
      %span.reply-or-view-online= t(:'discussion_mailer.reply_or_view_online_html', url: tracked_url(@event.eventable), hostname: AppConfig.theme[:site_name])
      %br

      - if @event_key == 'group_mentioned'
        %span.notification-reason= t("event_mailer.notification_reason.group_mentioned")
        %a.unsubscribe-link{href: unsubscribe_url(@event.eventable)}= t(:"common.action.unsubscribe")

      - elsif @event_key == 'user_mentioned' || @event_key == 'comment_replied_to'
        %span.notification-reason= t("event_mailer.notification_reason.user_mentioned")
        %a.unsubscribe-link{href: preferences_url}= t(:"common.action.unsubscribe")

      - elsif @event.all_recipient_user_ids.include?(@recipient.id)
        %span.notification-reason= t("event_mailer.notification_reason.notified")
        %a.unsubscribe-link{href: unsubscribe_url(@event.eventable)}= t(:"common.action.unsubscribe")

      - elsif @membership&.volume == 'loud'
        %span.notification-reason= t("event_mailer.notification_reason.group_subscribed")
        %a.unsubscribe-link{href: unsubscribe_url(@event.eventable)}= t(:"common.action.unsubscribe")

      - elsif @discussion && DiscussionReader.for(user: @recipient, discussion: @discussion).volume == 'loud'
        %span.notification-reason= t("event_mailer.notification_reason.discussion_subscribed")
        %a.unsubscribe-link{href: unsubscribe_url(@event.eventable)}= t(:"common.action.unsubscribe")

      - elsif @poll && @poll.stances.latest.find_by(participant_id: @recipient.id)&.volume == 'loud'
        %span.notification-reason= t("event_mailer.notification_reason.poll_subscribed")
        %a.unsubscribe-link{href: unsubscribe_url(@event.eventable)}= t(:"common.action.unsubscribe")

  = image_tag AppConfig.theme[:email_footer_logo_src], height: 24, alt: "Logo", class: "thread-mailer__footer-logo"
